package MeteoCal.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @authors Guttadoro, Iommazzo, Saullo
 */
@Embeddable
public class CommentwrittenPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "idComment")
    private int idComment;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idUser")
    private int idUser;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idEvent")
    private int idEvent;

    public CommentwrittenPK() {
    }

    public CommentwrittenPK(int idComment, int idUser, int idEvent) {
        this.idComment = idComment;
        this.idUser = idUser;
        this.idEvent = idEvent;
    }

    public int getIdComment() {
        return idComment;
    }

    public void setIdComment(int idComment) {
        this.idComment = idComment;
    }

    public int getIdUser() {
        return idUser;
    }

    public void setIdUser(int idUser) {
        this.idUser = idUser;
    }

    public int getIdEvent() {
        return idEvent;
    }

    public void setIdEvent(int idEvent) {
        this.idEvent = idEvent;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idComment;
        hash += (int) idUser;
        hash += (int) idEvent;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CommentwrittenPK)) {
            return false;
        }
        CommentwrittenPK other = (CommentwrittenPK) object;
        if (this.idComment != other.idComment) {
            return false;
        }
        if (this.idUser != other.idUser) {
            return false;
        }
        if (this.idEvent != other.idEvent) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "MeteoCal.entity.CommentwrittenPK[ idComment=" + idComment + ", idUser=" + idUser + ", idEvent=" + idEvent + " ]";
    }
    
}
